
/*
 * Copyright 2002-2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2012原作者。
 *
 *根据Apache许可证2.0版许可（“许可证”）；
 *除非符合许可证的规定，否则您不得使用此文件。
 *您可以在以下网址获取许可证副本：
 *
 *https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证进行的分发是在“按原样”的基础上进行的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限的特定语言，请参阅许可证和
 *许可证下的限制。
 */

package org.springframework.instrument.classloading;

import java.lang.instrument.ClassFileTransformer;

/**
 * Defines the contract for adding one or more
 * {@link ClassFileTransformer ClassFileTransformers} to a {@link ClassLoader}.
 *
 * <p>Implementations may operate on the current context {@code ClassLoader}
 * or expose their own instrumentable {@code ClassLoader}.
 *
 * @author Rod Johnson
 * @author Costin Leau
 * @since 2.0
 * @see java.lang.instrument.ClassFileTransformer
 */
/**
 *定义用于添加一个或多个的合同
 *｛@link ClassFileTransformer ClassFileTransformers｝到｛@link ClassLoader｝。
 *
 *＜p＞实现可以在当前上下文上操作｛@code ClassLoader｝
 *或者公开它们自己的可检测的{@code ClassLoader}。
 *
 *@作者罗德·约翰逊
 *@作者Costin Leau
 *@自2.0起
 *@参见java.lang.instrument.ClassFileTransformer
 */
public interface LoadTimeWeaver {

	/**
	 * Add a {@code ClassFileTransformer} to be applied by this
	 * {@code LoadTimeWeaver}.
	 * @param transformer the {@code ClassFileTransformer} to add
	 */
	/**
	 *添加要由此应用的｛@code ClassFileTransformer｝
	 *｛@code LoadTimeWeaver｝。
	 *@param transformer要添加的｛@code ClassFileTransformer｝
	 */
	void addTransformer(ClassFileTransformer transformer);

	/**
	 * Return a {@code ClassLoader} that supports instrumentation
	 * through AspectJ-style load-time weaving based on user-defined
	 * {@link ClassFileTransformer ClassFileTransformers}.
	 * <p>May be the current {@code ClassLoader}, or a {@code ClassLoader}
	 * created by this {@link LoadTimeWeaver} instance.
	 * @return the {@code ClassLoader} which will expose
	 * instrumented classes according to the registered transformers
	 */
	/**
	 *返回支持插入的｛@code ClassLoader｝
	 *通过基于用户定义的AspectJ风格的加载时编织
	 *｛@link ClassFileTransformer ClassFileTransformers｝。
	 *＜p＞可以是当前的｛@code ClassLoader｝，也可以是｛@code-ClassLoader｝
	 *由该｛@link LoadTimeWeaver｝实例创建。
	 *@返回将公开的｛@code ClassLoader｝
	 *根据注册变压器的仪表化等级
	 */
	ClassLoader getInstrumentableClassLoader();

	/**
	 * Return a throwaway {@code ClassLoader}, enabling classes to be
	 * loaded and inspected without affecting the parent {@code ClassLoader}.
	 * <p>Should <i>not</i> return the same instance of the {@link ClassLoader}
	 * returned from an invocation of {@link #getInstrumentableClassLoader()}.
	 * @return a temporary throwaway {@code ClassLoader}; should return
	 * a new instance for each call, with no existing state
	 */
	/**
	 *返回一个一次性的{@code ClassLoader}，使类
	 *在不影响父级｛@code ClassLoader｝的情况下加载和检查。
	 *<p>是否应该<i>不</i>返回｛@link ClassLoader｝的相同实例
	 *从调用{@link#getInstrumentableClassLoader（）}返回。
	 *@return一个临时丢弃的方法{@code ClassLoader}；应返回
	 *每个调用都有一个新实例，没有现有状态
	 */
	ClassLoader getThrowawayClassLoader();

}
